<template>
  <el-config-provider :locale="locale">
    <htsh-layout :logo="logo" :menu="menu" :toolbar="toolbar">
      <router-view></router-view>
    </htsh-layout>
  </el-config-provider>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { menus } from "@/router";
import SettingImg from "@/assets/icon/icon-layer.png";
import locale from "element-plus/lib/locale/lang/zh-cn";

export default defineComponent(function DefaultLayout() {
  const logo = { text: "综合服务平台" };
  const menu = {
    mode: "both",
    items: menus
  };
  const toolbar = {
    className: "my-toolbar",
    items: [
      { component: "time" },
      {
        icon: SettingImg,
        component: "img",
        onClick: (val: any) => {
          console.log("click toolbar", val);
        }
      },
      {
        component: "login-name",
        onClick: () => {
          console.log("go user info");
        }
      },
      { component: "exit", text: "登出" }
    ]
  };

  return {
    locale,
    logo,
    menu,
    toolbar
  };
});
</script>
<style lang="scss"></style>
